Skip to content

Add Wasmtime latest/LTS support with LTS default#301

Open
jsturtevant wants to merge 2 commits into
hyperlight-dev:mainfrom
jsturtevant:update-wasmtime
Open

Add Wasmtime latest/LTS support with LTS default#301
jsturtevant wants to merge 2 commits into
hyperlight-dev:mainfrom
jsturtevant:update-wasmtime

Conversation

@jsturtevant

@jsturtevant jsturtevant commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

Introduces wasmtime_lts feature flag to switch between wasmtime versions.
Default uses latest (39.0.1), pass --lts flag to AOT compiler for LTS version (36.0.3). CI updated to test both.

@jsturtevant jsturtevant added the kind/enhancement New feature or request label Dec 10, 2025
@jsturtevant jsturtevant marked this pull request as draft December 10, 2025 04:33
@jsturtevant jsturtevant force-pushed the update-wasmtime branch 7 times, most recently from ae7ec12 to 165ceab Compare December 15, 2025 19:48
@jsturtevant jsturtevant marked this pull request as ready for review December 16, 2025 20:17
@ludfjig

ludfjig commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

LGTM, but shouldn't default be LTS? Otherwise it would be a break change. Or maybe that's what we want?

Comment on lines +22 to +35
// Re-export wasmtime based on expected version
#[cfg(all(feature = "wasmtime_latest", feature = "wasmtime_lts"))]
compile_error!(
"Features 'wasmtime_latest' and 'wasmtime_lts' are mutually exclusive. Please enable only one."
);

#[cfg(not(any(feature = "wasmtime_latest", feature = "wasmtime_lts")))]
compile_error!("Either 'wasmtime_latest' or 'wasmtime_lts' feature must be enabled.");

#[cfg(not(feature = "wasmtime_lts"))]
extern crate wasmtime;
#[cfg(feature = "wasmtime_lts")]
extern crate wasmtime_lts as wasmtime;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any value in making these not mutually exclusive? If both are enabled, we could default to one of them, similar to mshv and mshv3 used to work in hyperlight. I think mutually exclusive features are generally discouraged

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think there was any value in having both. I did default to one in the cargo.toml so that the users wouldn't need to choose. If its discouraged I could try it with both

@jsturtevant

Copy link
Copy Markdown
Contributor Author

Otherwise it would be a break change. Or maybe that's what we want?

I don't think it is a breaking change, just a decency bump. My thought was that most WASM users would want to the latest wasmtime.

@jsturtevant jsturtevant force-pushed the update-wasmtime branch 4 times, most recently from 4c8fece to 5af7655 Compare March 20, 2026 20:59
@ludfjig

ludfjig commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

@jsturtevant let's get this merged but with LTS as default?

Introduces wasmtime_lts feature flag to switch between wasmtime versions.
Default uses latest (39.0.1), pass --lts flag to AOT compiler or enable
wasmtime_lts feature for LTS version (36.0.3). CI updated to test both.

Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
@jsturtevant jsturtevant changed the title Add support for both wasmtime latest (39.x) and LTS (36.x) versions Add Wasmtime latest/LTS support with LTS default Jun 10, 2026
Map Wasmtime 45 direct errors into Hyperlight guest errors and avoid latest-only component post_return deprecation while preserving LTS behavior.

Run clippy with the latest and LTS Wasmtime feature sets separately so mutually exclusive features are not enabled together.

Signed-off-by: James Sturtevant <jsturtevant@gmail.com>

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants